package com.lqd.mall.system;

import com.lqd.mall.basis.constant.ParamTypeConstants;
import com.lqd.mall.basis.response.CommonResult;
import com.lqd.mall.basis.response.Result;
import com.lqd.mall.interaction.basis.vo.TableDataInfoVo;
import com.lqd.mall.interaction.system.SysDictTypeEntity;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author 零起点
 * @create 2022-03-21 17:56
 */
@RequestMapping("dict/type")
@Api(tags = "字典数据管理")
public interface SysDictTypeControllerApi {

    /**
     * 查询字典数据
     * @param entity
     * @return
     */
    @GetMapping("list")
    @ApiOperation("查询字典数据")
    Result<TableDataInfoVo<SysDictTypeEntity>> list(SysDictTypeEntity entity);

    /**
     * 根据id查询数据
     * @param dictId            字典id
     * @return                  字典信息
     */
    @GetMapping("{dictId}")
    @ApiOperation("根据id查询数据")
    @ApiImplicitParam(name = "dictId",value = "字典id",paramType = ParamTypeConstants.PATH,required = true)
    Result<SysDictTypeEntity> findSYSDictTypeEntity(@PathVariable("dictId") Long dictId);

    /**
     * 更新数据
     * @param entity
     * @return
     */
    @PutMapping
    @ApiOperation("更新字典数据")
    CommonResult upateSYSDictTypeEntity(@RequestBody SysDictTypeEntity entity);
}
